package com.jike.shop.cloud.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jike.shop.cloud.entity.ShopCartEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author: lql
 * @date: 2022/7/10 22:50
 * @description:
 */
@Mapper
public interface ShopCartMapper extends BaseMapper<ShopCartEntity> {

    /**
     * 根据用户id、商品id查询购物车是否添加过商品
     *
     * @param userId    用户id
     * @param productId 商品id
     * @return entity
     */
    ShopCartEntity selectAllByUserIdAndProductId(@Param("userId") String userId, @Param("productId") Long productId);


}
